package com.xy.biz.fd.domain.converter;

import java.util.Collection;
import java.util.List;

import com.xy.biz.fd.domain.req.GetDocumentReleaseOftenUseRequest;
import com.xy.tool.util.BeanUtilsEx;
import com.xy.biz.fd.domain.bo.DocumentReleaseOftenUseBO;
import com.xy.biz.fd.domain.po.DocumentReleaseOftenUsePO;
import com.xy.biz.fd.domain.query.DocumentReleaseOftenUseQuery;
import com.xy.biz.fd.domain.resp.GetDocumentReleaseOftenUseResponse;
import com.xy.biz.fd.domain.req.SaveDocumentReleaseOftenUseRequest;
import com.xy.biz.fd.domain.req.ListDocumentReleaseOftenUseRequest;

/**
 * 
 * 
 * @author zgy
 * @date 2021-6-15
 */
public class DocumentReleaseOftenUseConverter {
	
	public static DocumentReleaseOftenUsePO toPO(DocumentReleaseOftenUseBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentReleaseOftenUsePO(), true);
	}
	
	public static List<DocumentReleaseOftenUsePO> toPO(Collection<DocumentReleaseOftenUseBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentReleaseOftenUsePO(), true);
	}
	
	public static DocumentReleaseOftenUseBO fromPO(DocumentReleaseOftenUsePO source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentReleaseOftenUseBO());
	}
	
	public static List<DocumentReleaseOftenUseBO> fromPO(Collection<DocumentReleaseOftenUsePO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentReleaseOftenUseBO());
	}
	
	public static DocumentReleaseOftenUseBO toBO(SaveDocumentReleaseOftenUseRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentReleaseOftenUseBO(), true);
	}

	public static DocumentReleaseOftenUseBO toBO(GetDocumentReleaseOftenUseRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentReleaseOftenUseBO(), true);
	}
	
	public static List<DocumentReleaseOftenUseBO> toBO(Collection<SaveDocumentReleaseOftenUseRequest> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentReleaseOftenUseBO(), true);
	}
	
	public static GetDocumentReleaseOftenUseResponse toResponse(DocumentReleaseOftenUseBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new GetDocumentReleaseOftenUseResponse());
	}
	
	public static List<GetDocumentReleaseOftenUseResponse> toResponse(Collection<DocumentReleaseOftenUseBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetDocumentReleaseOftenUseResponse());
	}
	
	public static DocumentReleaseOftenUseQuery toQuery(ListDocumentReleaseOftenUseRequest source) {
		if(null == source) {
			return null;
		}
		DocumentReleaseOftenUseQuery target = new DocumentReleaseOftenUseQuery(source.getPageIndex(), source.getPageSize());
		BeanUtilsEx.copyProperties(source, target);
		return target;
	}

}
